# -*- mode: python ; coding: utf-8 -*-
# 单文件打包配置 - 所有内容打包到一个exe文件中

import os

current_dir = os.path.dirname(os.path.abspath(__name__))

# 数据文件（同样需要包含）
datas = [
    ('res', 'res'),
    ('麻将图片', '麻将图片'),
    ('密码学者', '密码学者'),
    ('规则.txt', '.'),
    ('README_码将.md', '.'),
    ('密码学者功能说明.md', '.'),
    ('更新说明.md', '.'),
    ('术语替换说明.md', '.'),
    ('win.table', '.'),
    ('win_crypto.table', '.'),
]

hiddenimports = [
    'pygame',
    'pygame.mixer',
    'pygame.font',
    'pygame.image',
    'pygame.display',
    'pygame.event',
    'pygame.key',
    'pygame.mouse',
    'pygame.transform',
    'pygame.time',
    'pygame.surface',
    'collections',
    'random',
    'time',
    'sys',
    'os',
]

a = Analysis(
    ['game.py'],
    pathex=[current_dir],
    binaries=[],
    datas=datas,
    hiddenimports=hiddenimports,
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=None,
    noarchive=False,
)

pyz = PYZ(a.pure, a.zipped_data, cipher=None)

# 单文件打包配置
exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.zipfiles,
    a.datas,
    [],
    name='码将-密码学麻将-单文件版',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    upx_exclude=[],
    runtime_tmpdir=None,
    console=False,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
    icon='res/pic/mahjong.ico'
) 